﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Detai.Admin.ViewModels.SinhvienEditViewModel>" %>
<%@ Import Namespace="Detai.Lib.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Thêm sinh viên
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if(ViewData["MessageInfo"]==null){ %>
    <% using (Html.BeginForm("Create", "Sinhvien", FormMethod.Post, new { id = "adminForm" } )) {%>
        <%= Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Thêm mới</legend>
			<font color="red">*</font> là trường bắt buộc phải nhập.
			<table class="admintable">
				<tbody>
				<tr>
					<td class="key">Họ tên sinh viên(<font color="red">*</font>)</td>
					<td>
						<%= Html.TextBoxFor(model => model.Sinhvien.Hoten, new { @class = "required",style="width:250px" ,title="Nhập tên sinh viên" })%>
					</td>
				</tr>
				<tr>
					<td class="key">Lớp</td>
					<td>
						<%= Html.DropDownListFor(m => m.Sinhvien.Malop,new SelectList(Model.Lophocs,"Malop","Tenlop").ToList(),"--Chọn lớp--", new {@class="required",  style = "width:150px", title="Chọn lớp" })%>
					</td>
				</tr>
				<tr>
				    <td class="key">Email</td>
				    <td>
				        <%=Html.TextBoxFor(m=>m.Sinhvien.Email,new {@class="required", style="width:250px", title="Nhập email"}) %>
				    </td>
				</tr>
				<tr>
				    <td class="key">Điện thoại</td>
				    <td>
				        <%=Html.TextBoxFor(m=>m.Sinhvien.SDT,new {style="width:250px"}) %>
				    </td>
				</tr>
				<tr>
				    <td class="key">Ngày sinh</td>
				    <td>
				        <%=Html.TextBox("birdthday", null, new { @class = "datepicker", style = "width:90px" })%>
				    </td>
				</tr>
				<tr>
				    <td class="key">Giới tính</td>
				    <td>
				        <%=Html.RadioButtonFor(m => m.Sinhvien.Gioitinh, true, new { @checked="checked"})%> Nam
				        <%=Html.RadioButtonFor(m => m.Sinhvien.Gioitinh, false)%> Nữ
				    </td>
				</tr>
				<tr>
				    <td class="key">Địa chỉ</td>
				    <td>
				        <%=Html.TextBoxFor(m=>m.Sinhvien.Diachi,new {style="width:550px"}) %>
				    </td>
				</tr>
				<tr>
				    <td class="key">Thông tin khác</td>
				    <td>
				        <%=Html.TextAreaFor(m=>m.Sinhvien.Mota,new {raws=10, style="width:550px"})%>
				    </td>
				</tr>
				<tr>
					<td colspan="2" align="center"><input type="submit" value="Thêm sinh viên" /></td>
				</tr>
			   </tbody>
			 </table>
        </fieldset>

    <% } %>
    <script type="text/javascript">
		$(document).ready(function() {
			$("#adminForm").validate();});
		$(document).ready(function() {
			$("#adminForm").validate();        });
        tinyMCE.init({
            mode: "textareas",
            theme: "advanced",
            plugins: "paste,imagemanager",
            theme_advanced_buttons1: "pastetext,separator,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,insertimage",
            theme_advanced_buttons2: "",
            theme_advanced_buttons3: "",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_statusbar_location: "bottom",
            paste_use_dialog: false,
            paste_auto_cleanup_on_paste: true,
            paste_convert_headers_to_strong: false,
            paste_strip_class_attributes: "all",
            paste_remove_spans: true,
            paste_remove_styles: true
        });
        $.datepicker.setDefaults($.datepicker.regional['vi']);
        $(".datepicker").datepicker({
            dateFormat: "dd/mm/yy",
            changeMonth: true,
            yearRange: "1920",
            showOn: "button",
            buttonImage: "/Images/calendar.gif",
            buttonImageOnly: true,
            changeYear: true
        });
	</script>
<% } %>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
	<%= Html.Toolbar("Quay lại", "/Lophoc", "back")%>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Header" runat="server">
	Thêm lớp học
</asp:Content>

